<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="icon" type="image/ico" th:href="@{/images/favicon.ico}">
    <link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/css/index.css}">
    <title>官网菜单列表</title>
</head>
<body class="layui-tab-content">
<div class="layui-card layui-card-body">
<div class="layui-form toolbar" id="queryTools">
    <div class="layui-form-item">
        <label class="layui-form-label">菜单名称:</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="name" placeholder="请填写名称">
        </div>
        <label class="layui-form-label">创建时间:</label>
        <div class="layui-input-inline">
            <input type="text" lay-verify="date" class="layui-input" id="startDate" placeholder="请选择开始时间">
        </div>
        <div class="layui-input-inline">
            <input type="text" lay-verify="date" class="layui-input" id="endDate" placeholder="请选择结束时间">
        </div>
        <button class="layui-btn" id="btnSearch">查询</button>
        <button class="layui-btn" id="resetSearch">重置</button>
        <button class="layui-btn" id="btnAdd">新增</button>
    </div>
</div>
<table class="layui-hide" id="menuWebTable" lay-filter="menuWebTable"></table>
</div>
<!--新增修改界面-->
<form class="layui-form" id="editForm" lay-filter="editForm" style="display:none;padding-top:10px">
    <input type="hidden" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="layui-tip-required">*</i>父级菜单</label>
        <div class="layui-input-inline">
            <select id="pid" name="pid" lay-verify="required">
                <option value="">请选择</option>
                <option value="0">无父级菜单</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="layui-tip-required">*</i>菜单名称</label>
        <div class="layui-input-inline">
            <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="请输入名称"
                   class="layui-input layui-form-danger">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="layui-tip-required">*</i>菜单排序</label>
        <div class="layui-input-inline">
            <input type="text" name="sort" lay-verify="required" autocomplete="off" placeholder="请输入排序数值"
                   class="layui-input layui-form-danger">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="layui-tip-required">*</i>菜单显示</label>
        <div class="layui-input-inline" id="statusDiv">
            <!--<input type="checkbox" name="status" lay-skin="switch" lay-text="显示|不显示" value="1">-->
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="layui-tip-required">*</i>权限码</label>
        <div class="layui-input-inline">
            <input type="text" name="authCode" lay-verify="required" autocomplete="off" placeholder="请输入权限码"
                   class="layui-input layui-form-danger">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label"><i class="layui-tip-required">*</i>菜单路径</label>
        <div class="layui-input-inline">
            <input type="text" name="link" lay-verify="required" autocomplete="off" placeholder="请输入路径地址"
                   class="layui-input layui-form-danger">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">菜单描述</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入菜单描述" class="layui-textarea" name="remark"></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <button id="saveRecord" class="layui-btn" lay-submit lay-filter="editRecord">保存</button>
    </div>
</form>
<!--渲染列-->
<script type="text/html" id="statusClo">
    <!-- 这里的 checked 的状态只是演示 -->
    <input type="checkbox" name="sex" value="{{d.id}}" lay-skin="switch" lay-filter="setStatus" {{ d.status == 1 ? 'checked' : '' }}>
</script>
<!--列操作-->
<script type="text/html" id="barDemo">
    {{# if(d.pid == 0 && d.authCode !='index'){ }}
    <a class="layui-btn layui-btn-xs" lay-event="editChild">添加子菜单</a>
    {{# } }}
    <a class="layui-btn layui-btn-xs" lay-event="edit">修改</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<!--按钮操作-->
<script type="text/html" id="tableToolbar">
    <div class="layui-btn-container">

    </div>
</script>

<script type="text/javascript" th:src="@{/js/plugins/jquery-1.11.3.min.js}"></script>
<script type="text/javascript" th:src="@{/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/js/modules/menuWeb/list.js}"></script>
</body>
</html>